<?php

/**
 * language actions.
 *
 * @package    sfI18nMessagesPlugin
 * @subpackage language
 * @author     sfI18nMessagesPlugin
 * @version    SVN: $Id: actions.class.php 23810 2009-11-12 11:07:44Z Kris.Wallsmith $
 */
class languageActions extends sfActions
{
 /**
  * Executes index action
  *
  * @param sfRequest $request A request object
  */
  public function executeIndex(sfWebRequest $request)
  {
    $this->forward('default', 'module');
  }

  public function executeChangeCulture(sfWebRequest $request)
  {
    $this->getUser()->setCulture($request->getParameter('language'));

    //$this->getUser()->setExtendedCulture($request->getParameter('language').'_'.$request->getParameter('country'));

    /*
    if ($this->getUser()->getModelUser())
    {
      $this->getUser()->getModelUser()->changeExtendedCulture($request->getParameter('language').'_'.$request->getParameter('country'));
    }
     */

    $this->getUser()->isFirstRequest(false);

    $this->redirect('@localized_homepage');
  }
}
